﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="LoaiHangManager.aspx.cs" Inherits="Web.Admin.LoaiHangManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="panel-heading">
    <h3 class="panel-title"><b>Danh sách loại hàng</b></h3>
</div>
<div class="panel-body">
    <a href="LoaiHangForm.aspx" class="btn btn-primary">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Thêm mới
    </a>
    <asp:Label ID="lblMessage" runat="server" Text="" CssClass="alert alert-danger" role="alert" Visible="False"></asp:Label>
    <br /><br />
    <asp:GridView ID="GridView1" runat="server" CssClass="table table-hover" 
        AutoGenerateColumns="False" BorderStyle="None" GridLines="None" 
        onrowcommand="GridView1_RowCommand" >
        <Columns>
            <asp:BoundField DataField="MaLoaiHang" HeaderText="Mã ">
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="TenLoaiHang" HeaderText="Tên Loại Hàng" />
            <asp:TemplateField ConvertEmptyStringToNull="False" HeaderText="Số lượng hàng">
                <ItemTemplate>
                    <span class="badge">
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("SoLuong") %>'></asp:Label>
                    </span>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="#">
                <ItemTemplate>
                    <asp:LinkButton ID="btnDelete" runat="server" 
                        CommandArgument='<%# Eval("MaLoaiHang") %>' CommandName="cmdDelete" 
                        OnClientClick="return confirm('Bạn có muốn xóa người dùng này không?');" 
                        CssClass="btn btn-warning">
                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Xóa
                        </asp:LinkButton> 
                    <asp:HyperLink ID="HyperLink1" runat="server" CssClass="btn btn-danger"
                        NavigateUrl='<%# "LoaiHangForm.aspx?MaLoaiHang=" + Eval("MaLoaiHang") %>'>
                        <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> Sửa
                        </asp:HyperLink>
                </ItemTemplate>
                <ItemStyle CssClass="col-action" />
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</div>
</asp:Content>
